<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="ALL">
    <Appenders>
        <Console name="Console">
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
        </Console>
        <RollingFile
                name="RollingFileAll"
                fileName="logs/all.log"
                filePattern="logs/$${date:yyyy-MM-dd}/all/app-%d{yyyy-MM-dd}-%i.log.gz"
        >
            <ThresholdFilter level="ALL" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="100 MB"/>
                <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </Policies>
        </RollingFile>
        <RollingFile
                name="RollingFileInfo"
                fileName="logs/info.log"
                filePattern="logs/$${date:yyyy-MM-dd}/info/app-%d{yyyy-MM-dd}-%i.log.gz"
        >
            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="100 MB"/>
                <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </Policies>
        </RollingFile>
        <RollingFile
                name="RollingFileDebug"
                fileName="logs/debug.log"
                filePattern="logs/$${date:yyyy-MM-dd}/debug/app-%d{yyyy-MM-dd}-%i.log.gz"
        >
            <ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="100 MB"/>
                <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </Policies>
        </RollingFile>
        <RollingFile
                name="RollingFileWarn"
                fileName="logs/warn.log"
                filePattern="logs/$${date:yyyy-MM-dd}/warn/app-%d{yyyy-MM-dd}-%i.log.gz"
        >
            <ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="100 MB"/>
                <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </Policies>
        </RollingFile>
        <RollingFile
                name="RollingFileError"
                fileName="logs/error.log"
                filePattern="logs/$${date:yyyy-MM-dd}/error/app-%d{yyyy-MM-dd}-%i.log.gz"
        >
            <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="100 MB"/>
                <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </Policies>
        </RollingFile>
        <RollingFile
                name="RollingFileTrace"
                fileName="logs/trace.log"
                filePattern="logs/$${date:yyyy-MM-dd}/trace/app-%d{yyyy-MM-dd}-%i.log.gz"
        >
            <ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="[%date %highlight{%-5level} (%t) %logger{36}:%M] -> %msg%n%throwable"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="100 MB"/>
                <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </Policies>
        </RollingFile>
    </Appenders>
    <Loggers>
        <Logger name="logger" level="ALL" additivity="false">
            <Appender-ref ref="Console"/>
            <Appender-ref ref="RollingFileAll"/>
            <Appender-ref ref="RollingFileInfo"/>
            <Appender-ref ref="RollingFileDebug"/>
            <Appender-ref ref="RollingFileWarn"/>
            <Appender-ref ref="RollingFileError"/>
            <Appender-ref ref="RollingFileTrace"/>
        </Logger>
        <Root level="ALL">
            <Appender-ref ref="Console"/>
            <Appender-ref ref="RollingFileAll"/>
            <Appender-ref ref="RollingFileInfo"/>
            <Appender-ref ref="RollingFileDebug"/>
            <Appender-ref ref="RollingFileWarn"/>
            <Appender-ref ref="RollingFileError"/>
            <Appender-ref ref="RollingFileTrace"/>
        </Root>
    </Loggers>
</Configuration>